package com.hgkj.cloud.base.service.impl;

import com.hgkj.cloud.base.common.PageInfo;
import com.hgkj.cloud.base.dao.TenantTableTasksMapper;
import com.hgkj.cloud.base.domain.TenantTableTasks;
import com.hgkj.cloud.base.service.TenantTableTasksService;
import com.hgkj.cloud.base.transactional.DBWriteTransactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class TenantTableTasksServiceImpl implements TenantTableTasksService {

    @Autowired
    private TenantTableTasksMapper tenantTableTasksMapper;

    @Override
    public int deleteByPrimaryKey(String uuid) {
        return tenantTableTasksMapper.deleteByPrimaryKey(uuid);
    }

    @Override
    public int insert(TenantTableTasks record) {
        return tenantTableTasksMapper.insert(record);
    }

    @Override
    public int insertSelective(TenantTableTasks record) {
        return tenantTableTasksMapper.insertSelective(record);
    }

    @Override
    public TenantTableTasks selectByPrimaryKey(String uuid) {
        return tenantTableTasksMapper.selectByPrimaryKey(uuid);
    }

    @Override
    @DBWriteTransactional
    public int updateByPrimaryKeySelective(TenantTableTasks record) {
        return tenantTableTasksMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(TenantTableTasks record) {
        return tenantTableTasksMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<TenantTableTasks> listAllTableTasks(PageInfo pi, Map<String, Object> map) {
        if (pi != null) {
            map.put("currentCount", pi.getCurrentCount());
            map.put("pageSize", pi.getPageSize());
        }
        return tenantTableTasksMapper.listAllTableTasks(map);
    }

    @Override
    public List<TenantTableTasks> listUnPublishTableTasks() {
        return tenantTableTasksMapper.listUnPublishTableTasks();
    }

    @Override
    public int findAllTableTaskCount(Map<String, Object> map) {
        return tenantTableTasksMapper.findAllTableTaskCount(map);
    }

    @Override
    public TenantTableTasks findTableTaskByUuid(String uuid) {
        return tenantTableTasksMapper.findTableTaskByUuid(uuid);
    }

    @Override
    public List<TenantTableTasks> getTaskByTable(Map map) {
        return tenantTableTasksMapper.getTaskByTable(map);
    }

    @Override
    public List<TenantTableTasks> getUserTask(Map map) {
        return tenantTableTasksMapper.getUserTask(map);
    }

    @Override
    public List<Map<String, Object>> getAllTaskByMap(Map map) {
        return tenantTableTasksMapper.getAllTaskByMap(map);
    }

    @Override
    public long findTasksCount(String admin_uuid) {
        return tenantTableTasksMapper.findTasksCount(admin_uuid);
    }

    @Override
    public long findDefaultTasksCount(String framework_id) {
        return tenantTableTasksMapper.findDefaultTasksCount(framework_id);
    }

    @Override
    public long findTasksCountByUserUuid(String user_uuid) {
        return tenantTableTasksMapper.findTasksCountByUserUuid(user_uuid);
    }

    @Override
    public TenantTableTasks getDefaultTaskByFrameworkId(Long frameworkId){
        return tenantTableTasksMapper.getDefaultTaskByFrameworkId(frameworkId);
    }

    @Override
    public List<Map<String, Object>> getUserDigitalTableMsg(Map map){
        return tenantTableTasksMapper.getUserDigitalTableMsg(map);
    }
}
